package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.scau.meetingbook.vo.ResultVO;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;


import java.util.List;

@Service
public class ${table.serviceImplName} extends ServiceImpl<${table.mapperName}, ${entity}> implements ${table.serviceName} {

    @Autowired
    private ${table.mapperName} ${entity?uncap_first}Mapper;

    @Override
    public ResultVO insert${entity}(${entity} ${entity?uncap_first}) throws Exception {
        ${entity?uncap_first}Mapper.insert(${entity?uncap_first});
        return ResultVO.success(null);
    }

    @Override
    public ResultVO<${entity}> get${entity}ById(Integer id) throws Exception {
        return ResultVO.success(null, ${entity?uncap_first}Mapper.selectById(id));
    }

    @Override
    public ResultVO update${entity}ById(${entity} ${entity?uncap_first}) throws Exception {
        ${entity?uncap_first}Mapper.updateById(${entity?uncap_first});
        return ResultVO.success(null);
    }

    @Override
    public ResultVO delete${entity}ById(Integer id) throws Exception {
        ${entity?uncap_first}Mapper.deleteById(id);
        return ResultVO.success(null);
    }
}